package tpalgo3.vista.sprites;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

import tpalgo3.vista.TableroSquare;
import tpalgo3.vista.util.VistaUtil;

public class Explosion extends JPanel {
	private static final long serialVersionUID = 9092292502139754997L;

	private static final String PATH_ICONO = "img/explosion.jpg";
	
	public Explosion() {
		ImageIcon icono = VistaUtil.createImageIcon(PATH_ICONO);
		this.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
		this.setPreferredSize(new Dimension(35, 35));
		this.setBackground(Color.WHITE);
		JLabel iconoLabel = new JLabel();
		iconoLabel.setIcon(icono);
		this.add(iconoLabel);
		this.setVisible(true);
	}
	
	public static TableroSquare quitarExplosion (int x, int y) {
		TableroSquare square = new TableroSquare();
		square.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
		square.setPreferredSize(new Dimension(35, 35));
		square.setBackground(new Color(255, 255, 255));
		square.setEquis(x);
		square.setIgriega(y);
		return square;
	}
}